
/*
 *
 *  Copyright (C) 2012-2024
 *  All rights reserved, Designed By 杭州连线客信息技术有限公司
 *  注意：
 *  本软件为杭州连线客信息技术有限公司开发研制，未经购买不得使用
 *  购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 *  一经发现盗用、分享等行为，将追究法律责任，后果自负
 *
 */

package com.lxk.oms.order.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.lxk.oms.order.domain.OmsOrderItem;
import com.lxk.oms.order.domain.bo.OmsOrderItemBo;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.Data;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.sensitive.annotation.Sensitive;
import org.dromara.common.sensitive.core.SensitiveStrategy;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 交易订单明细视图对象 oms_order_item
 *
 * @author LXK-RY5
 * @date 2024-08-20
 */
@Data
@ExcelIgnoreUnannotated
@AutoMappers(value = {
    @AutoMapper(target = OmsOrderItem.class),
    @AutoMapper(target = OmsOrderItemBo.class)
})
public class OmsOrderItemVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 订单项ID
     */
    @ExcelProperty(value = "订单项ID")
    private Long id;

    /**
     * 商户id
     */
    @ExcelProperty(value = "商户id")
    private Long merId;

    /**
     * 用户编号
     */
    @ExcelProperty(value = "用户编号")
    private Long userId;

    /**
     * 订单编号
     */
    @ExcelProperty(value = "订单编号")
    private Long orderId;

    /**
     * 商品 SPU ID
     */
    @ExcelProperty(value = "商品 SPU ID")
    private Long spuId;

    /**
     * 商品 SPU 名称
     */
    @ExcelProperty(value = "商品 SPU 名称")
    private String spuName;

    /**
     * 商品 SKU ID
     */
    @ExcelProperty(value = "商品 SKU ID")
    private Long skuId;

    /**
     * SKU名称
     */
    @ExcelProperty(value = "SKU名称")
    private String skuName;

    /**
     * SKU图片
     */
    @ExcelProperty(value = "SKU图片")
    private String picUrl;

    /**
     * 购买数量
     */
    @ExcelProperty(value = "购买数量")
    private Integer count;

    /**
     * 商品单价
     */
    @ExcelProperty(value = "商品单价")
    private BigDecimal price;

    /**
     * 商品总价=单价x数量
     */
    @ExcelProperty(value = "商品总价=单价x数量")
    private BigDecimal totalPrice;

    /**
     * 商品级优惠（总）
     */
    @ExcelProperty(value = "商品级优惠", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "总=")
    private BigDecimal discountPrice;

    /**
     * 可售后订单数量
     */
    @ExcelProperty(value = "可售后订单数量")
    private Integer saleAfterNum;

    /**
     * 已售后的数量
     */
    @ExcelProperty(value = "已售后的数量")
    private Integer saleAfterNumSold;

    /**
     * 售后状态  0=未售后, 1=部分售后,2=全部售后
     */
    @ExcelProperty(value = "售后状态  0=未售后, 1=部分售后,2=全部售后")
    private Integer saleAfterStatus;

    /**
     * 一级分类
     */
    @ExcelProperty(value = "一级分类")
    private Long oneCategoryId;

    /**
     * 二级分类
     */
    @ExcelProperty(value = "二级分类")
    private Long twoCategoryId;

    /**
     * 三级分类
     */
    @ExcelProperty(value = "三级分类")
    private Long threeCategoryId;

    /**
     * 订单类型 0=普通订单
     */
    @ExcelProperty(value = "订单类型 0=普通订单")
    private Integer orderType;

    /**
     * 订单成本总价
     */
    @Sensitive(strategy = SensitiveStrategy.CLEAR, perms = "order:price:show")
    private BigDecimal orderCostPrice;

    /**
     * 订单市场总价
     */
    @Sensitive(strategy = SensitiveStrategy.CLEAR, perms = "order:price:show")
    private BigDecimal orderMarkerPrice;

    /**
     * 订单利润=totalPrice-orderCostPrice
     */
    @Sensitive(strategy = SensitiveStrategy.CLEAR, perms = "order:price:show")
    private BigDecimal orderProfitPrice;

    /**
     * 订单成本总价
     */
    @Sensitive(strategy = SensitiveStrategy.CLEAR, perms = "order:price:show")
    private BigDecimal totalOrderCostPrice;

    /**
     * 订单市场总价
     */
    @Sensitive(strategy = SensitiveStrategy.CLEAR, perms = "order:price:show")
    private BigDecimal totalOrderMarkerPrice;

    /**
     * 订单利润=totalPrice-orderCostPrice
     */
    @Sensitive(strategy = SensitiveStrategy.CLEAR, perms = "order:price:show")
    private BigDecimal totalOrderProfitPrice;


    /**
     * 子订单编码
     */
    private String orderItemSn;

    /**
     * 单个积分
     */
    private BigDecimal point;

    /**
     * 总积分
     */
    private BigDecimal totalPoint;
}
